package com.shangxian.giveithome.mapper;

import com.shangxian.giveithome.entity.Place;
import com.shangxian.giveithome.entity.SearchPeople;
import com.shangxian.giveithome.entity.SearchPeopleCreate;
import com.shangxian.giveithome.entity.SearchPeopleUpdate;
import com.shangxian.giveithome.entity.SearchPet;
import com.shangxian.giveithome.entity.SearchPetCreate;
import com.shangxian.giveithome.entity.SearchPetUpdate;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface SearchMapper {

    /**
     * 获取寻主总条数
     *
     * @param id
     * @return
     */
    Integer searchPeopleCount(Long id);

    Integer searchPeopleCountHistory(Long id);

    List<SearchPeople> searchPeopleRelationship(@Param("id") Long id, @Param("pageNum") int pageNum, @Param("pageSize") int pageSize);

    List<SearchPeople> searchPeopleRelationshipHistory(@Param("id") Long id, @Param("pageNum") int pageNum, @Param("pageSize") int pageSize);


    Integer searchPetCount(Long id);


    Integer searchPetCountHistory(Long id);


    List<SearchPet> searchPetRelationshipHistory(@Param("id") Long id, @Param("pageNum") int pageNum, @Param("pageSize") int pageSize);


    List<SearchPet> searchPetRelationship(@Param("id") Long id, @Param("pageNum") int pageNum, @Param("pageSize") int pageSize);

    /**
     * 查看寻宠详情
     *
     * @param id
     * @return
     */
    SearchPet searchPetDetails(Long id);

    SearchPeople searchPeopleDetails(Long id);

    List<Place> queryPlaceMe(@Param("id") Long id, @Param("pageNum") int pageNum, @Param("pageSize") int pageSize);

    void save(SearchPetCreate searchPetCreate);

    void update(SearchPetUpdate searchPetUpdate);

    void updateStatus(@Param("id") Long id, @Param("status") int status);

    void savPeople(SearchPeopleCreate searchPeopleCreate);

    void updatePeople(SearchPeopleUpdate searchPeopleUpdate);

    void delete(Long id);

    void deletePeople(Long id);

    void updatePeopleStatus(@Param("id") Long id, @Param("status") int statusi);
}
